﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TheHeGeoCommercial.Master
{
    public partial class UcVMenu : System.Web.UI.UserControl
    {
        public string Url { get; set; }
        public string MenuTxt { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Url == null) return;
            var str = Url.Split('/');
            if (Url != null && RootMaster.GetCurrentFile().Equals(str[str.Length - 1])||RootMaster.GetCurrentDictName().Contains(str[str.Length-2]))
            {
                divContent.Attributes.Add("class", "menu-active");
            }
            else
            {
               divContent.Attributes.Add("class", "menu-inactive");
            }
            ltxt.Attributes.Add("onclick", "window.location.href='" + Url + "'");
            ltxt.InnerText = MenuTxt;
        }
    }
}